<template>
    <div>
      <h1>欢迎访问Home页面</h1>
      <button @click="logout">退出</button>
    </div>
  </template>
  
  <script>
  import { useRouter } from "vue-router";
  
  export default {
    setup() {
      const router = useRouter();
  
      const logout = () => {
        localStorage.removeItem("account");
        router.push("/");
      };
  
      return {
        logout
      };
    }
  };
  </script>